import { http } from "@/utils/request";
import type {
  pagerListQueryType,
  pagerListQueryTypeResponse,
} from "@/interface/common.ts";
import type { pmTemplateVORes } from "@/interface/pm/pmTemplate.ts";

export const createPmTemp = (
  data: pmTemplateVORes,
): Promise<pmTemplateVORes> => {
  return http.post("/projectTemplate/create", data);
};

export const updatePmTemp = (data: pmTemplateVORes): Promise<any> => {
  return http.put("/projectTemplate/edit", data);
};

export const getPmTempList = (
  data: pagerListQueryType,
): Promise<pagerListQueryTypeResponse<pmTemplateVORes>> => {
  return http.post("/projectTemplate/list", data);
};

export const getPmTempInfo = (id: string): Promise<pmTemplateVORes> => {
  return http.get(`/projectTemplate/${id}`);
};

export const deletePmTemp = (id: string): Promise<any> => {
  return http.delete(`/projectTemplate/${id}`);
};
